package com.ldcc.report_system.api.results;

import androidx.annotation.NonNull;

import java.util.List;

/**
 * @author wwg
 * @version JDK 11
 * @description 后端返回分页数据后端返回分页数据
 * @create 2021-10-15 11:15
 **/
public class PageResult<T> {

    /**
     * 查询数据列表
     */
    private List<T> records;

    /**
     * 总数
     */
    private long total;
    /**
     * 每页显示条数
     */
    private long size;

    /**
     * 当前页
     */
    private long current;

    public PageResult() {
    }

    public PageResult(List<T> records, long total, long size, long current) {
        this.records = records;
        this.total = total;
        this.size = size;
        this.current = current;
    }

    public List<T> getRecords() {
        return records;
    }

    public void setRecords(List<T> records) {
        this.records = records;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public long getSize() {
        return size;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public long getCurrent() {
        return current;
    }

    public void setCurrent(long current) {
        this.current = current;
    }

    @NonNull
    @Override
    public String toString() {
        return "PageResult{" +
                "records=" + records +
                ", total=" + total +
                ", size=" + size +
                ", current=" + current +
                '}';
    }
}
